import React from 'react';
import ReactDOM from 'react-dom';
import './style/index.less';
import App from './component/App';
import routes from "./route/route"
import logo from './image/logo.svg';

import { BrowserRouter, Switch, Route, NavLink } from 'react-router-dom'



/***
 * 若是单页面应用或者不使用 route ，可以将 /route 及下route文件删除，
 * 并直接使用 ReactDOM.render(<App />, document.getElementById('app'));
 * 在 App.js 中去除 Link 跳转
 */
// ReactDOM.render(Route, document.getElementById('app'));



ReactDOM.render(
    <BrowserRouter>
        <div className="App">
            <App />
            <Switch>
                {
                    routes.map((route,index) => (
                        <Route key={index} path={route.path} component={route.component} exact={route.exact} />
                    ))
                }
            </Switch>
        </div>
    </BrowserRouter>,
    document.getElementById('app')
);
